using System.Utility.Helper;
using System.Utility.System;

namespace System.Utility.Logger
{
	public static class LogHelper
	{
		private static SimpleLogger _logger;

		public static string LogPath
		{
			set
			{
				_logger.LogPath = value;
			}
		}

		static LogHelper()
		{
			_logger = new SimpleLogger()
			{
				LogPath = File.GetPhysicalPath("Log")
			};
		}

		public static void Debug(string message, Exception exception = null)
		{
			_logger.Log(message, TypeExtension.GetDescription(LogLevel.Debug), exception);
		}

		public static void Error(string message, Exception exception = null)
		{
			_logger.Log(message, TypeExtension.GetDescription(LogLevel.Error), exception);
		}

		public static void Fatal(string message, Exception exception = null)
		{
			_logger.Log(message, TypeExtension.GetDescription(LogLevel.Fatal), exception);
		}

		public static void Info(string message, Exception exception = null)
		{
			_logger.Log(message, TypeExtension.GetDescription(LogLevel.Info), exception);
		}

		public static void Warn(string message, Exception exception = null)
		{
			_logger.Log(message, TypeExtension.GetDescription(LogLevel.Warn), exception);
		}

		private enum LogLevel
		{
			Info,
			Debug,
			Warn,
			Error,
			Fatal
		}
	}
}